import React, { Component } from 'react';
import '../styles/MySwiper.css' 

import { Swiper } from 'antd-mobile'
class MySwiper extends Component {
    constructor(props) {
        super(props)
       
    }
  
    render() {
        return (
            <div className='swiper'>
                <Swiper loop autoplay autoplayInterval={2000}>
                    {this.props.banner &&
                        this.props.banner.length&&
                    this.props.banner.map((item,index) => {
                        return (
                            <Swiper.Item  key={index}> <img src={item.pic} alt="" /></Swiper.Item>
                        )
                    })
              }
             </Swiper>
            </div>
        );
    }
}

export default MySwiper;